<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang"ja" lang="ja">
<head>
    <title>作業時間管理 on GAE | カレンダー</title>
    <link type="text/css" rel="stylesheet" href="/stylesheets/default.css"/>
    <link type="text/css" rel="stylesheet" href="/stylesheets/alert.css"/>
    <link type="text/css" rel="stylesheet" href="/stylesheets/alphacube.css"/>    
    <script type="text/javascript" src="/scripts/prototype.js"> </script>
    <script type="text/javascript" src="/scripts/effects.js"> </script>
    <script type="text/javascript" src="/scripts/window.js"> </script>
    <script type="text/javascript" src="/scripts/window_effects.js"> </script>
    <script type="text/javascript" src="/scripts/debug.js"> </script>
	<!-- mfkd libraly //-->    
    <link type="text/css" rel="stylesheet" href="/stylesheets/workingtimeinput.css" />
	<script type="text/javascript" src="/scripts/mfkd.js"></script>
	<script type="text/javascript">
		window.onload = function() {
			Focus.Index = {	{{ kaishi_field }}:"{{ syuryo_field }}",
						    {{ syuryo_field }}:"{{ jitudo_field }}",
						    {{ jitudo_field }}:"{{ zan_futu_field }}",
						    {{ zan_futu_field }}:"{{ zan_sinya_field }}",
						    {{ zan_sinya_field }}:"{{ zan_gokei_field }}",
						    {{ zan_gokei_field }}:"{{ comment_field }}",
						    {{ comment_field }} :"enter"};
		    //
		    $("{{ kaishi_field }}").onfocus    = function() { Focus.GotFocus(this);};
		    $("{{ kaishi_field }}").onblur     = function() { Focus.LostFocus(this); };
		    $("{{ kaishi_field }}").focus();
		    //
		    $("{{ syuryo_field }}").onfocus    = function() { Focus.GotFocus(this);};
		    $("{{ syuryo_field }}").onblur     = function() { Focus.LostFocus(this); };
		    //
		    $("{{ jitudo_field }}").onfocus    = function() { Focus.GotFocus(this);};
		    $("{{ jitudo_field }}").onblur     = function() { Focus.LostFocus(this); };
		    //
		    $("{{ zan_futu_field }}").onfocus    = function() { Focus.GotFocus(this);};
		    $("{{ zan_futu_field }}").onblur     = function() { Focus.LostFocus(this); };
		    //
		    $("{{ zan_sinya_field }}").onfocus    = function() { Focus.GotFocus(this);};
		    $("{{ zan_sinya_field }}").onblur     = function() { Focus.LostFocus(this); };
		    //
		    $("{{ zan_gokei_field }}").onfocus    = function() { Focus.GotFocus(this);};
		    $("{{ zan_gokei_field }}").onblur     = function() { Focus.LostFocus(this); };
		    //
		    $("{{ comment_field }}").onfocus    = function() { Focus.GotFocus(this);};
		    $("{{ comment_field }}").onblur     = function() { Focus.LostFocus(this); };
		}
		function keypress(event, id) {
	        // ｷｰの取得
	        if (event.keyCode != 0) { key = event.keyCode; }
	        else { key = event.charCode; }
	        
	        if ( id == "{{ kaishi_field }}" ) { Validator.Validation($(id), key, {"IsTime":""}); }
	        if ( id == "{{ syuryo_field }}" ) { Validator.Validation($(id), key, {"IsTime":""}); }
	        if ( id == "{{ jitudo_field }}" )    { Validator.Validation($(id), key, {"IsNumeric":""}); }
	        if ( id == "{{ zan_futu_field }}" )  { Validator.Validation($(id), key, {"IsNumeric":""}); }
	        if ( id == "{{ zan_sinya_field }}" ) { Validator.Validation($(id), key, {"IsNumeric":""}); }
	        if ( id == "{{ zan_gokei_field }}" ) { Validator.Validation($(id), key, {"IsNumeric":""}); }
	        if ( id == "{{ comment_field }}" ) { Validator.Validation($(id), key); }
		};		
		function check() {
			var err = "";

			err = Validator.IsTime($("{{ kaishi_field }}").value);
			if (err != "") {
				Validator.ShowAlert($("{{ kaishi_field }}"), err);
				return false;
			};
			
			err = Validator.IsTime($("{{ syuryo_field }}").value);
			if (err != "") {
				Validator.ShowAlert($("{{ syuryo_field }}"), err);
				return false;
			};

			err = Validator.IsNumeric($("{{ jitudo_field }}").value);
			if (err != "") {
				Validator.ShowAlert($("{{ jitudo_field }}"), err);
				return false;
			};

			err = Validator.IsNumeric($("{{ zan_futu_field }}").value);
			if (err != "") {
				Validator.ShowAlert($("{{ zan_futu_field }}"), err);
				return false;
			};

			err = Validator.IsNumeric($("{{ zan_sinya_field }}").value);
			if (err != "") {
				Validator.ShowAlert($("{{ zan_sinya_field }}"), err);
				return false;
			};

			err = Validator.IsNumeric($("{{ zan_gokei_field }}").value);
			if (err != "") {
				Validator.ShowAlert($("{{ zan_gokei_field }}"), err);
				return false;
			};

			document.myform.submit();
		}	
	</script> 	
</head>
<body>
	<!-- メニュー -->
	<div class="menu">
		<script type="text/javascript">     
		function setinitial() {
			var win = new Window({className: "alphacube",
								  title: "作業時間管理 on GAE | 一括作成",
								  width:800,
								  height:200, 
			                      url: "/SetInitial?date={{ date_str }}",
			                      onClose:function () { location.href="/?date={{ date_str }}"; } })
			win.showCenter(true);
		}
		function getcsv() {
			var win = new Window({className: "alphacube",
								  title: "作業時間管理 on GAE | CSV出力",
								  width:500,
								  height:200, 
			                      url: "/GetCsv?date={{ date_str }}",
			                      onClose:function () { location.href="/?date={{ date_str }}"; } })
			win.showCenter(true);
		} 		
		function registration() {
			var win = new Window({className: "alphacube",
								  title: "作業時間管理 on GAE | ユーザ情報",
								  width:500,
								  height:340, 
			                      url: "/Registration",
			                      onClose:function () { location.href="/?date={{ date_str }}"; } })
			win.showCenter(true);
		} 		
		</script>		
		<ul>
			<li><a href="./?date={{ prevmonth_str }}">前月</a></li>
			<li><span class="separator">｜</span></li>
	    	<li><a href="./">当月</a></li>
			<li><span class="separator">｜</span></li>
	    	<li><a href="./?date={{ nextmonth_str }}">翌月</a></li>
			<li><span class="separator">｜</span></li>
	    	<li><a href="javascript:setinitial();">一括作成</a></li>
			<li><span class="separator">｜</span></li>
	    	<li><a href="javascript:getcsv();">CSV出力</a></li>
			<li><span class="separator">｜</span></li>
	    	<li><a href="javascript:registration();">ユーザ情報</a></li>
			<li><span class="separator">｜</span></li>
	    	<li><a href="./Logout">ログアウト</a></li>
		</ul>
    </div>
    <!-- コンテンツ -->
	<div class="contents">
		<p class="title">カレンダー</p>
	    <form name="myform" action="/" method="post">	
		<table>
			<tr class="header">
	        	<th>日</th>
	            <th>作業開始</th>
	            <th>作業終了</th>
	            <th>実働時間</th>
	            <th>普通残業</th>
	            <th>深夜残業</th>
	            <th>残業合計</th>
	            <th>有休消化等</th>
	            <th></th>                
	        </tr>
			{{ calender_html }}
		</table>
		<input type="hidden" name="date" value="{{ date_str }}" />
		</form>
	   	<p><a href="http://www.ubuntulinux.jp/">Linux</a>版の<a href="http://www.google.co.jp/chrome">Google Chorme</a>、<a href="http://mozilla.jp/firefox/">Firefox3.6.8</a>で確認をしています。</p>
	   	<p>他のブラウザ使用時にJavaScriptエラーが出るようでしたら連絡ください。</p> 
	</div>
	<div class="footer">
		<p>Created by <a href="http://www.mfkd.info/">Mfkd</a> 2010/08/12(<a href="http://code.google.com/p/workingtimeinput/">Ver:0.2.0 beta-1</a>)</p>
	<div>
</body>
</html>

